//идём в начало
0, ,<,01
01,1,<,01
01,0,<,01
01, ,<,02


// Рассматриваем ситуации если печатная головка встретила 1

02,1, ,13
13, ,>,14
14, ,>,03

03,1,>,03
03,0,>,03
03, ,<,04

// 1 1

04,1, ,05
05, ,>,06
06, ,>,07
07, ,1,211

211,1,<,2113
2113, ,<,2112
2112,1,<,2112
2112,0,<,2112
2112, ,<,2112112

2112112,1,<,2112112
2112112,0,<,2112112
2112112, ,<,811

811,1,<,811
811,0,<,811
811, , ,8114

8114, ,1,8714
8714,1,<,87144

87144,1, ,8118
87144,0, ,8018

8118, ,>,81188
81188,1,>,81188
81188,0,>,81188
81188, ,>,811888

811888,1,>,811888
811888,0,>,811888
811888, ,1,8174

8174,1,<,817

817,1, ,8116

8116, ,>,777
777,1,>,777
777,0,>,777
777, ,>,81133

81133,1,>,81133
81133,0,>,81133
81133, ,1,8113355

8113355,1,<,8113355
8113355,0,<,8113355
8113355, ,<,811335555

811335555,1,<,811335555
811335555,0,<,811335555
811335555, ,<,81133555555

81133555555,1,<,81133555555
81133555555,0,<,81133555555
81133555555, ,<,811

817,0, ,8106

8106, ,>,70707
70707,1,>,70707
70707,0,>,70707
70707, ,>,81033

81033,1,>,81033
81033,0,>,81033
81033, ,0,8103355

8103355,1,<,8103355
8103355,0,<,8103355
8103355, ,<,810335555

810335555,1,<,810335555
810335555,0,<,810335555
810335555, ,<,81033555555

81033555555,1,<,81033555555
81033555555,0,<,81033555555
81033555555, ,<,810

817, ,<,999111999

999111999,1,<,999111999
999111999,0,<,999111999
999111999, ,1,999111999000

999111999000,1,>,999111999000
999111999000,0,>,999111999000
999111999000, ,>,9991119990001

9991119990001,1,>,9991119990001
9991119990001,0,>,9991119990001
9991119990001, ,>,99911199900011

99911199900011,1,>,99911199900011
99911199900011,0,>,99911199900011
99911199900011, , ,901090000000000000123


//end

807, ,<,9991119990

9991119990,1,<,9991119990
9991119990,0,<,9991119990
9991119990, ,0,9991119990000

9991119990000,1,>,9991119990000
9991119990000,0,>,9991119990000
9991119990000, ,>,99911199900010

99911199900010,1,>,99911199900010
99911199900010,0,>,99911199900010
99911199900010, ,>,999111999000110

999111999000110,1,>,999111999000110
999111999000110,0,>,999111999000110
999111999000110, , ,901090000000000000123


// -> 0

8018, ,>,80188
80188,1,>,80188
80188,0,>,80188
80188, ,>,801888

801888,1,>,801888
801888,0,>,801888
801888, ,1,8074

8074,1,<,807

807,1, ,8016

8016, ,>,777000
777000,1,>,777000
777000,0,>,777000
777000, ,>,80133

80133,1,>,80133
80133,0,>,80133
80133, ,0,8013355

8013355,1,<,8013355
8013355,0,<,8013355
8013355, ,<,801335555

801335555,1,<,801335555
801335555,0,<,801335555
801335555, ,<,80133555555

80133555555,1,<,80133555555
80133555555,0,<,80133555555
80133555555, ,<,801

807,0, ,8006

8006, ,>,70707000
70707000,1,>,70707000
70707000,0,>,70707000
70707000, ,>,80033

80033,1,>,80033
80033,0,>,80033
80033, ,0,8003355

8003355,1,<,8003355
8003355,0,<,8003355
8003355, ,<,800335555

800335555,1,<,800335555
800335555,0,<,800335555
800335555, ,<,80033555555

80033555555,1,<,80033555555
80033555555,0,<,80033555555
80033555555, ,<,800

//900 kod konca 1 zna4eniya

87144, ,>,901

901,1,>,901
901,0,>,901
901, ,>,9010

//PODPROGRAMMA

9010,1,>,999
9010,0,>,999

999,1,>,999
999,0,>,999
999, ,1,901090



9000,1,>,9990
9000,0,>,9990

9990,1,>,9990
9990,0,>,9990
9990, ,0,900090


//


9010, ,1,901090

901090,1,>,901090
901090,0,>,901090
901090, ,>,901090000000000000

901090000000000000,1,>,901090000000000000
901090000000000000,0,>,901090000000000000
901090000000000000, , ,901090000000000000123




// 1 0

04,0, ,051
051, ,>,061
061, ,>,071
071, ,0,210

210,0,<,2103
2103, ,<,2102
2102,1,<,2102
2102,0,<,2102
2102, ,<,2102102

2102102,1,<,2102102
2102102,0,<,2102102
2102102, ,<,810

810,1,<,810
810,0,<,810
810, , ,8104

8104, ,1,8704
8704,1,<,87044

87044,1, ,8108
87044,0, ,8008

8108, ,>,81088
81088,1,>,81088
81088,0,>,81088
81088, ,>,810888

810888,1,>,810888
810888,0,>,810888
810888, ,0,817400000

817400000,0,<,817

// -> 0

8008, ,>,80088
80088,1,>,80088
80088,0,>,80088
80088, ,>,800888

800888,1,>,800888
800888,0,>,800888
800888, ,0,80741231230

80741231230,0,<,807

87044, ,>,900

900,1,>,900
900,0,>,900
900, ,>,9000
9000, ,0,900090

900090,1,>,900090
900090,0,>,900090
900090, ,>,900090000000000000

900090000000000000,1,>,900090000000000000
900090000000000000,0,>,900090000000000000
900090000000000000, , ,901090000000000000123


//0

02,0, ,130
130, ,>,140
140, ,>,030

030,1,>,030
030,0,>,030
030, ,<,040

// 0 1

040,1, ,050
050, ,>,060
060, ,>,070
070, ,0,201

201,0,<,2013
2013, ,<,2012
2012,1,<,2012
2012,0,<,2012
2012, ,<,2012112

2012112,1,<,2012112
2012112,0,<,2012112
2012112, ,<,801

801,1,<,801
801,0,<,801
801, , ,8014

8014, ,0,8714567567
8714567567,0,<,87144


// 0 0

040,0, ,0501
0501, ,>,0601
0601, ,>,0701
0701, ,0,200

200,0,<,2003
2003, ,<,2002
2002,1,<,2002
2002,0,<,2002
2002, ,<,2002112

2002112,1,<,2002112
2002112,0,<,2002112
2002112, ,<,800

800,1,<,800
800,0,<,800
800, , ,8004

8004, ,0,8704567567
8704567567,0,<,87044



901090000000000000123, ,<,919818
919818,0, ,901090000000000000123
919818, ,>,91
91, ,0,9889886767676

9889886767676,0,>,988988

919818,1, ,9555
9555, ,<,95555
95555,1,>,95
95555,0,>,95


95555, ,>,9707077070

9707077070, ,1,95000101010
95000101010,1,>,988988

95, ,>,96
96, ,1,97

97,1,<,97
97,0,<,97
97, ,<,98
98, ,<,98
98,0, ,9801
98,1, ,9811

9801, ,<,98011
98011,1,>,980
98011,0,>,980
98011, ,>,999111
999111, ,>,999111
999111,1,>,123123456
999111,0,>,123123456

123123456,1,>,123123456
123123456,0,>,123123456
123123456, ,0,98898812
98898812,0,>,98898810101088889999129340

9811, ,<,98111
98111,1,>,981
98111,0,>,981
98111, ,>,999111123
999111123, ,>,999111123
999111123,1,>,123123456123
999111123,0,>,123123456123

123123456123,1,>,123123456123
123123456123,0,>,123123456123
123123456123, ,1,988988123123

988988123123,1,>,98898810101088889999129340


980, ,>,980
980,1,>,9809090
980,0,>,9809090

9809090,1,>,9809090
9809090,0,>,9809090
9809090, ,0,97

981, ,>,981
981,1,>,9819090
981,0,>,9819090

9819090,1,>,9819090
9819090,0,>,9819090
9819090, ,1,97


98898810101088889999129340, ,<,111222333

111222333,1,<,111222333
111222333,0,<,111222333
111222333, ,<,1478
1478, ,>,1689
1689, ,>,7898678

7898678,1, ,78986781
78986781, ,<,789867811
789867811, ,1,7898678111
7898678111,1,>,1689

7898678,0, ,78986780
78986780, ,<,789867800
789867800, ,0,7898678000
7898678000,0,>,1689

7898678, ,<,98898810101088889999129340



1478,1,>,147878666
1478,0,>,147878666
147878666, ,>,147878
147878,1,>,147878
147878,0,>,147878
147878, , ,988988

988988, , ,988988


